package com.zh.freechat.domain.notice;


import com.zh.freechat.domain.user.entity.ChatUser;

import java.util.Objects;

/**
 * @author ZH
 * @date 18:21 2022/2/22
 */
public class ApplyFriendMessageFactory {

    public static ApplyFriendMessage create(ChatUser friend, String receiver){
        Objects.requireNonNull(friend,"friend 不能为null");
        ApplyFriendMessage message = new ApplyFriendMessage(receiver);
        message.setUserId(friend.getUid());
        message.setUsername(friend.getUsername());
        message.setAvatarUrl(friend.getAvatarUrl());
        message.setNickname(friend.getNickname());
        message.setGender(friend.getGender());
        return message;
    }

}
